import { sub1 } from './sub/sub1.js'
import { sub2 } from './sub/sub2.js'
import { sub3 } from './sub/sub3.js'
import { sub4 } from './sub/sub4.js'
import { sub5 } from './sub/sub5.js'
import { replaceFirstAndLast, replaceRepeatSymbol } from '../../Utils/common'
export function presentIllnessHistory(data) {
  const sub1Context = sub1(data)
  console.log('sub1Context = ' + JSON.stringify(sub1Context))

  const sub2Context = sub2(data)
  console.log('sub2Context = ' + JSON.stringify(sub2Context))

  const sub3Context = sub3(data)
  console.log('sub3Context = ' + JSON.stringify(sub3Context))

  const sub4Context = sub4(data)
  console.log('sub4Context = ' + JSON.stringify(sub4Context))

  const sub5Context = sub5(data)
  console.log('sub5Context = ' + JSON.stringify(sub5Context))

  let str = ''
  if (sub1Context) str += replaceFirstAndLast(replaceRepeatSymbol(sub1Context))
  if (sub2Context)
    str =
      str +
      (sub1Context ? '\n' : '') +
      replaceFirstAndLast(replaceRepeatSymbol(sub2Context))
  if (sub3Context)
    str =
      str +
      (sub2Context ? '\n' : '') +
      replaceFirstAndLast(replaceRepeatSymbol(sub3Context))
  if (sub4Context)
    str =
      str +
      (sub3Context ? '\n' : '') +
      replaceFirstAndLast(replaceRepeatSymbol(sub4Context))
  if (sub5Context)
    str =
      str +
      (sub4Context ? '\n' : '') +
      replaceFirstAndLast(replaceRepeatSymbol(sub5Context))
  return str
}
